{include file="public/head"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header"> {if $info}编辑权限{else}添加权限{/if}</div>
                <div class="layui-card-body" pad15>
                    <blockquote class="layui-elem-quote">
                        1、《控/方》：意思是 控制器/方法; 例如 Admin/index<br/>
                        2、图标名称为左侧导航栏目的图标样式，具体可查看<a href="http://www.layui.com/doc/element/icon.html" target="_blank">LayUI字体图标</a>图标CSS样式
                    </blockquote>
                    <div class="layui-form" wid100 lay-filter="form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">父级</label>
                            <div class="layui-input-inline">
                                <select name="pid" lay-verify="required" lay-filter="pid" >
                                    <option value="0">默认顶级</option>
                                    {volist name="list" id="vo"}
                                    {if $info}
                                    <option value="{$vo.id}">{$vo.ltitle}</option>
                                    {else /}
                                    <option {if $pid==$vo.id}selected{/if} value="{$vo.id}">{$vo.ltitle}</option>
                                    {/if}
                                    {/volist}
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">权限名称</label>
                            <div class="layui-input-inline">
                                <input type="text" name="title" class="layui-input" lay-verify="required" autocomplete="off" placeholder="请输入权限名称">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">控制器/方法</label>
                            <div class="layui-input-inline">
                                <input type="text" name="url" lay-verify="required" placeholder="请输入控制器/方法" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">菜单名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="name" lay-verify="required" placeholder="请输入菜单名" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">图标名称</label>
                            <div class="layui-input-inline">
                                <input type="text" name="icon" placeholder="请输入图标名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">菜单状态</label>
                            <div class="layui-input-block">
                                <input type="radio" name="menustatus" value="1" title="开启" >
                                <input type="radio" name="menustatus" value="0" title="关闭">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">排序</label>
                            <div class="layui-input-inline" style="width: 80px;">
                                <input type="text" name="sort" placeholder="排序编号" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="id">
                                <button class="layui-btn" lay-submit lay-filter="{if $info}edit-rule{else}add-rule{/if}">确认保存</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/foot"/}
<script>
    layui.config({
        base: '__LAYADMIN__/',
        version: true
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','form', 'auth'],function(){
        var form = layui.form;
        form.val("form", {$info|raw})
    });
</script>
</body>
</html>